package com.deyuanyun.pic.pbf.app.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;

import java.math.BigDecimal;
/**
 * @Description 参考点信息dto
 * @author Jerry
 * @date 2016-07-07
 */
public class RefPointInfoDTO {
    private String id;//定位点种类id
    private String typeName;//定位点种类（Mark、环焊缝、弯头）
    private BigDecimal mileage;//绝对距离
    private BigDecimal relativeMileage;//相对距离
    private String fromCrossClock;//上游交汇时钟位置
    private String toCrossClock;//下游交汇时钟位置
    private String gisId;//地图gis


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public BigDecimal getMileage() {

        return  mileage.setScale(3, BigDecimal.ROUND_HALF_UP);
    }
    public BigDecimal getRelativeMileage() {

        return relativeMileage.setScale(3,BigDecimal.ROUND_HALF_UP);
    }
    public void setMileage(BigDecimal mileage) {
        this.mileage = mileage;
    }
    public void setRelativeMileage(BigDecimal relativeMileage) {
        this.relativeMileage = relativeMileage;
    }
    public String getTypeName() {
        if(typeName.length() == 32){
            String name = CodeUtil.getName(typeName);
            return  name.substring(0,name.length()-1);
        }
        return typeName;
    }
    public String getFromCrossClock() {
        return fromCrossClock;
    }
    public String getToCrossClock() {
        return toCrossClock;
    }
    public String getGisId() {
        return gisId;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    public void setFromCrossClock(String fromCrossClock) {
        this.fromCrossClock = fromCrossClock;
    }
    public void setToCrossClock(String toCrossClock) {
        this.toCrossClock = toCrossClock;
    }
    public void setGisId(String gisId) {
        this.gisId = gisId;
    }



}
